/*
 *  Copyright 2003 by Spectrum Digital Incorporated.
 *  All rights reserved. Property of Spectrum Digital Incorporated.
 */

/*
 *  ======== evmdm642_aic23_loopback.c ========
 *  EVMDM642_AIC23_loopback() implementation
 */
 
#include <evmdm642.h>
#include <evmdm642_aic23.h>

/*
 *  ======== EVMDM642_AIC23_loopback ========
 *  Enable/disable codec loopback mode
 */
void EVMDM642_AIC23_loopback(EVMDM642_AIC23_CodecHandle hCodec, Int16 mode)
{
    int regval;
    
    /* Set bypass bit if mode is true */
    regval = (mode) ? 0x8 : 0x0;
    
    /* Write to codec register */
    EVMDM642_AIC23_rset(hCodec, EVMDM642_AIC23_ANAPATH,
        (EVMDM642_AIC23_rget(hCodec, EVMDM642_AIC23_ANAPATH) & 0xfff7 | regval));
}
